<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>cthink - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> 
	<link href="{$static}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">

    <link href="{$static}/css/animate.min.css" rel="stylesheet">
    <link href="{$static}/css/style.min.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <h3>欢迎使用 cthink</h3>

            <form class="m-t" role="form" id="f" action="{:url('login/index')}">
                <div class="form-group">
                    <input type="text" name="username" class="form-control" placeholder="用户名">
                </div>
                <div class="form-group">
                    <input type="password" name="password" class="form-control" placeholder="密码">
                </div>
                <button type="button" class="btn btn-primary block full-width m-b">登 录</button>
				<div class="form-group errmsg" style="color:red;"></div>
            </form>
        </div>
    </div>
    <script src="{$static}/js/jquery.min.js?v=2.1.4"></script>
    <script src="{$static}/js/bootstrap.min.js?v=3.3.6"></script>
	<script>
		$(function(){
			$('button').click(function(){
				var form = $('#f').serialize();
				var url = $('#f').attr('action');
				$.post(url,form).success(function(data){
					if(data.code == 1){
						location.href = '{:url("index/index")}';
					}else{
						$('.errmsg').html(data.msg);
						setTimeout(function(){
							$('.errmsg').html('');
						},3000);
					}
				});
			});
		});
	</script>
</body>
</html>
